package com.xsm.activitygroup;

import java.util.ArrayList;

import com.umeng.analytics.MobclickAgent;
import com.xsm.activitygroup.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Conditions extends Activity{
ListView clist;	
String result="全部";
ArrayAdapter<String> adapter;
String type="";
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
	super.onCreate(savedInstanceState);
	setContentView(R.layout.conditions);
	type=getIntent().getExtras().getString("type");
	clist=(ListView)findViewById(R.id.choseList);	
	final ArrayList<String> valueStrings=new ArrayList<String>();
	if(type.equals("school")){
	valueStrings.add("广州中医药大学");
	valueStrings.add("广东药学院");
	valueStrings.add("华南理工大学");
	valueStrings.add("广东工业大学");
	valueStrings.add("广州大学");
	valueStrings.add("广州美术学院");
	valueStrings.add("广东外语外贸大学");
	valueStrings.add("星海音乐学院");
	valueStrings.add("中山大学");
	valueStrings.add("华南师范大学");
	valueStrings.add("全部");
	}

	 adapter=new ArrayAdapter<String>(this,R.layout.listtext,valueStrings);
	clist.setAdapter(adapter);
	clist.setOnItemClickListener(new OnItemClickListener() {
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
				long arg3) {
Intent intent=new Intent();
intent.putExtra("result", valueStrings.get(arg2));
setResult(RESULT_OK,intent);
finish();
		}
	  });
}

public void Back(View view){
	finish();
}
@Override
	protected void onResume() {
	MobclickAgent.onResume(this);
		super.onResume();
	}

@Override
	protected void onPause() {
	MobclickAgent.onResume(this);
		super.onPause();
	}
}
